#define MIDI_ON 144
#define MIDI_OFF 128
#define MIDI_CHANNEL 0

int fsrPin = 1;           // FSR pin
char status = 0;
int fsr = 0;
float temp = 0.0;

// Send a MIDI message (without checking values)
void midiSend( char cmd, char data1, char data2 )
{
  Serial.print( cmd, BYTE );
  Serial.print( data1, BYTE );
  Serial.print( data2, BYTE );
}


void setup()
{
  Serial.begin( 9600 );  // set the MIDI baud rate 31250
}

void loop()
{
  fsr = analogRead( fsrPin );    // read the input pin
  temp = fsr;
  temp *= 40;
  temp /= 1024;
  temp += 50;                     // scale the value between 50 - 90
  fsr = 60;

  status = MIDI_ON + MIDI_CHANNEL;
  midiSend( status, fsr, 64 );   // send a MIDI ``note on'' message

  delay(500);                    // delay 500 milliseconds

  status = MIDI_OFF + MIDI_CHANNEL;
  midiSend( status, fsr, 64 );   // send a MIDI ``note off'' message

  delay(500);                    // delay 500 milliseconds
  //Serial.print("Next Iter \n");
}

